package com.dangdang.sharding.dp.listener.observable;

import java.util.ArrayList;
import java.util.List;

import com.dangdang.sharding.dp.listener.observer.Observer;

public abstract class CommonObservable implements Observable {
	private List<Observer> observers = new ArrayList<>();
	@Override
	public void addObsver(Observer o) {
		observers.add(o);
	}

	@Override
	public void removeObsver(Observer o) {
		observers.remove(o);
	}

	@Override
	public void doNotify(String content) {
		for (Observer observer : observers) {
			observer.update(content);
		}
	}
}
